package com.slz3.business.module.socialManagement.socLife.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.socialManagement.socLife.domain.SocLife;
import com.slz3.business.module.socialManagement.socLife.domain.SocLifeCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SocLifeResAtomic {

    static Mono<ServerResponse> add_$SocLifeUpdateLock(ServerRequest req, SocLife socLife) {
        return SocLifeResSafeValid.add(req, socLife) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.add(req, socLife);
    }

    public static Mono<ServerResponse> delete_$SocLifeUpdateLock(ServerRequest req, SocLifeCondition socLifeCondition) {
        return SocLifeResSafeValid.delete(req, socLifeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$SocLifeUpdateLock(ServerRequest req, SocLife socLife) {
        return SocLifeResSafeValid.modify(req, socLife) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.modify(req, socLife);
    }

    static Mono<ServerResponse> info_$SocLifeUpdateLock(ServerRequest req) {
        return SocLifeResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$SocLifeUpdateLock(ServerRequest req, SocLifeCondition socLifeCondition) {
        return SocLifeResSafeValid.auditSubmit(req, socLifeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$SocLifeUpdateLock(ServerRequest req, SocLifeCondition socLifeCondition) {
        return SocLifeResSafeValid.audit(req, socLifeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$SocLifeUpdateLock(ServerRequest req, SocLifeCondition socLifeCondition) {
        return SocLifeResSafeValid.auditReject(req, socLifeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$SocLifeUpdateLock(ServerRequest req, SocLifeCondition socLifeCondition) {
        return SocLifeResSafeValid.usingEnable(req, socLifeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$SocLifeUpdateLock(ServerRequest req, SocLifeCondition socLifeCondition) {
        return SocLifeResSafeValid.usingDisable(req, socLifeCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                SocLifeResExecutor.usingDisable(req);
    }
}
